<template>
  <div id="header-left">
    <span class="logo" @click="routeToHome"></span>
  </div>
</template>

<script>
import types from 'utils/types.js'

export default {
  name: 'HeaderLeft',
  methods: {
    routeToHome () {
      // console.log(this.$history)
      this.$store.commit(types.CLOSE_SONG_DETAIL)
      if (this.$route.path === '/main/discover/recommend') return false
      this.$router.push('/main/discover/recommend')
      // 隐藏歌曲详细页
    }
  }
}
</script>

<style scoped lang="less">
#header-left {
  height: 100%;
  display: flex;
  align-items: center;
  .logo {
    display: block;
    width: 160px;
    height: 100%;
    background: url('~assets/img/logo.svg') no-repeat 18px 9px;
    background-size: 124px;
    cursor: pointer;
  }
}
</style>
